# Contributor: Orhun Parmaksız <orhunparmaksiz@gmail.com>
# Maintainer: Orhun Parmaksız <orhunparmaksiz@gmail.com>
pkgname=heh
pkgver=0.5.0
pkgrel=0
pkgdesc="A terminal UI to edit bytes by the nibble"
url="https://github.com/ndd7xv/heh"
arch="all !s390x !x86" # FTBFS
license="MIT"
makedepends="
	cargo
	cargo-auditable
	"
subpackages="$pkgname-doc"
source="$pkgname-$pkgver.tar.gz::https://github.com/ndd7xv/heh/archive/refs/tags/v$pkgver.tar.gz"
options="net"

prepare() {
	default_prepare

	cargo fetch --target="$CTARGET" --locked
}

build() {
	cargo auditable build --release --frozen
}

check() {
	cargo test --frozen
}

package() {
	install -Dm 755 "target/release/$pkgname" -t "$pkgdir/usr/bin"
	install -Dm 644 README.md -t "$pkgdir/usr/share/doc/$pkgname"
	install -Dm 644 LICENSE -t "$pkgdir/usr/share/licenses/$pkgname"
}

sha512sums="
3b1546d478ed8fb8a9a2b58215de1b957666f85f17c2db577a4e888c2b9d63c5e423b7585e19c9e526b42d2f6d0ebd71a17f4ae2f89fe1dc17be6eca2c58d781  heh-0.5.0.tar.gz
"
